UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TCQqZVLHdAQ7JCF/yHVpsjWffxJnAm8/zuzPjAyqqhE=' 
WHERE 
  key_id = 'c58e1ef686add1cb1b20ba76153a7319504616b389dd8d340d50ff129a2084e2' 
  AND (
    token = 'TCQqZVLHdAQ7JCF/yHVpsjWffxJnAm8/zuzPjAyqqhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041