UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jByvVOVj0uwNmb9rP0JtxTA5yc/H4RHjeBa62Xc/fvA=' 
WHERE 
  key_id = 'f5272352194e48f5ef0d6d3ad47ea7e0e5b0f1d18a8513e25d4a2b6d7bb257ce' 
  AND (
    token = 'jByvVOVj0uwNmb9rP0JtxTA5yc/H4RHjeBa62Xc/fvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035