UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V5aCcTEiIjNMvhYkwvROScdE7z8Bb/ol8YGbPv5H1Wk=' 
WHERE 
  key_id = '95f074cc6505cfe88fa7d8079738526b3b2d33a3d68c53ba455d9b3efb780597' 
  AND (
    token = 'V5aCcTEiIjNMvhYkwvROScdE7z8Bb/ol8YGbPv5H1Wk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019