UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's/AImo6crus3aVPjhZAd0w+1XI5J7RAbEBT9HVuhR1o=' 
WHERE 
  key_id = 'dc262c62e456724a2d5b48ce17ce2bde48611f021ecd64d65b4a2eda340b74f5' 
  AND (
    token = 's/AImo6crus3aVPjhZAd0w+1XI5J7RAbEBT9HVuhR1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041