UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U68IIspU2axqGKJvw1UFlgdGr4+upfZhLd/PUpbGodY=' 
WHERE 
  key_id = '1de12ea63d468a285030905b3cf73ae666bd45a5e0b0dec8c683bd8c2a5384a4' 
  AND (
    token = 'U68IIspU2axqGKJvw1UFlgdGr4+upfZhLd/PUpbGodY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034