UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YYRNHXOmol82nCfKZpyY1n6hkyFhZk/1BUjvR5tR77U=' 
WHERE 
  key_id = '57e5f713eff30d1a3f58964a1ee6e0dab13c175ec495889a8134641d7ba0e262' 
  AND (
    token = 'YYRNHXOmol82nCfKZpyY1n6hkyFhZk/1BUjvR5tR77U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046