UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r/DEENNJsZqQJOPHjKESJ+5gHoVzIdxRA9SvHh/1Dt0=' 
WHERE 
  key_id = '07674ca2f1a674e83c4b31c3d6f93821b53b75b0cbe80c5a51b65e9a5d233a67' 
  AND (
    token = 'r/DEENNJsZqQJOPHjKESJ+5gHoVzIdxRA9SvHh/1Dt0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026