UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c+uEoO3nvzWhtL6l9AxFcTUQpO8f8rIcTGSFsLnsfTY=' 
WHERE 
  key_id = 'c452d794647459eb319890db2586616eca267d3cfabb5ab1a0b7e8eaac873deb' 
  AND (
    token = 'c+uEoO3nvzWhtL6l9AxFcTUQpO8f8rIcTGSFsLnsfTY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015