UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z8IE4866Fk54fCkhVxzfl1WqDClFzwRTUlW7L2uFifY=' 
WHERE 
  key_id = '95740fe40384f90d2a34a373a73d8e5d4bb6d08d2d3a3d8e9573281a93c6ff64' 
  AND (
    token = 'Z8IE4866Fk54fCkhVxzfl1WqDClFzwRTUlW7L2uFifY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039