UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P+XxaShX1tDSS2FUbhP1a2VQw/TJ6X94nAnIxyWrd1Y=' 
WHERE 
  key_id = '98b5927658007921edc6fb1c3726ed6690679298ebc0be950b661ebe9ead2d47' 
  AND (
    token = 'P+XxaShX1tDSS2FUbhP1a2VQw/TJ6X94nAnIxyWrd1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015