UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'byEXQsg8r144V+AJoEMR+ezoRzsCDpzFSgCEAw+u/q0=' 
WHERE 
  key_id = '059be09da2edf8cd698005489547ea392911b0d8d2893f7f7763a685eed59e68' 
  AND (
    token = 'byEXQsg8r144V+AJoEMR+ezoRzsCDpzFSgCEAw+u/q0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027