UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S+88/HZ9MMy9xD08q8Mftu110HnfldUOqfM9YdfxY4g=' 
WHERE 
  key_id = '12b869d8a3ac13e5f576af76803ea48e7eeaead9b670665ac01df84d28e4e676' 
  AND (
    token = 'S+88/HZ9MMy9xD08q8Mftu110HnfldUOqfM9YdfxY4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067