UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BHm1hsCq77vUonS/YsjyErPs86a3iOEtIjlhGsN20os=' 
WHERE 
  key_id = '70c58b050fa6b39af6acec193b24d1dff3823601fb44f4a016594fecbfc80669' 
  AND (
    token = 'BHm1hsCq77vUonS/YsjyErPs86a3iOEtIjlhGsN20os=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039