UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/wUDqJtzE96II2TgMiziG1f1P0KMXK2pXCqH6+acfk8=' 
WHERE 
  key_id = '04e7033d19972ce74e1bb5e98cec78e6fb16ff53b2e460d23e2ea27edd7d2422' 
  AND (
    token = '/wUDqJtzE96II2TgMiziG1f1P0KMXK2pXCqH6+acfk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037