UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8+RPSf+/O9q6iQyJyVrbmp4vFJzE28gWKn8i8as4Nzs=' 
WHERE 
  key_id = 'c5f653fe6da116bb847ba2d77775bf8dfa2fb920619098581cbf16fa1cd703ae' 
  AND (
    token = '8+RPSf+/O9q6iQyJyVrbmp4vFJzE28gWKn8i8as4Nzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022