UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2XsjP3EQytS3fYX5IL4HJhTksILtg5Vs45+Jxd7JLOA=' 
WHERE 
  key_id = '7205e98f95252cbfd588381030e390a8a8029c14b7458f71d29ce3a6cc7db2b3' 
  AND (
    token = '2XsjP3EQytS3fYX5IL4HJhTksILtg5Vs45+Jxd7JLOA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048