UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vj0p/OAa8DNY6s7F8/Yz9fegbiwhXwiQywZvtlZ/iV4=' 
WHERE 
  key_id = 'a43cb9511e34160e7d99f8d7b8410fdab68bb4f7a6604da151595d027665bc47' 
  AND (
    token = 'vj0p/OAa8DNY6s7F8/Yz9fegbiwhXwiQywZvtlZ/iV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036