UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZAsNreg0AQITD5GOaZ+vsU2KGVcgqGUYGPAMSNgS/Fk=' 
WHERE 
  key_id = '9bcedc3bdfcb9c15c4d7b700dfe8d265022bf7a14b8c5cae95d5e99df7bbe92f' 
  AND (
    token = 'ZAsNreg0AQITD5GOaZ+vsU2KGVcgqGUYGPAMSNgS/Fk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027