UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3I1zx1Ny632IoGh18r+epNhqS9/BjgDfbQhH+O7dqRg=' 
WHERE 
  key_id = '21643b03a65493df45395c5e0a8b4ce69b11fa721cf5d91f028846dbd71dbb25' 
  AND (
    token = '3I1zx1Ny632IoGh18r+epNhqS9/BjgDfbQhH+O7dqRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017