UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PQV8dAFCmrgxKlvwDc8wws32OYel6AiV4jdj4VZj+sA=' 
WHERE 
  key_id = '1373ae01c95b4a2ec571cd32fb0a98145df1a77b49d4800cbfd1fd1c3edeff7e' 
  AND (
    token = 'PQV8dAFCmrgxKlvwDc8wws32OYel6AiV4jdj4VZj+sA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028