UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8eMLlaW/+tNYiiem/EyuhjTM8STxjpDF0QbYsP2dSjE=' 
WHERE 
  key_id = '050e7e0853cbea61408bdf90451fce9719f46efe1db6a32e013cfa5309c58d3c' 
  AND (
    token = '8eMLlaW/+tNYiiem/EyuhjTM8STxjpDF0QbYsP2dSjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040