UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HylmNBB9pviC9Hl29elr4T6TL+G9wYFEaCDdOuU9e9M=' 
WHERE 
  key_id = '0257d0891c543ad044e751cf60d067808257484034ed3b55370b4420340123d7' 
  AND (
    token = 'HylmNBB9pviC9Hl29elr4T6TL+G9wYFEaCDdOuU9e9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022