UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H5PJ7D/joDD+qa1OBq5/jj9hxWB7kYRPQKHQGgG/gD4=' 
WHERE 
  key_id = 'da817c437d6f6a0f4897c541fa35c61ba16490b6366872d8238b857b52cd9b5b' 
  AND (
    token = 'H5PJ7D/joDD+qa1OBq5/jj9hxWB7kYRPQKHQGgG/gD4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00206